import { useState } from 'react'
import { Cell, Icon } from 'react-vant'
export default ({ list, searchClick, clearAll, clearClick }) => {
    return (<div>
        <Cell.Group>
            <Cell title={'搜索历史'} ><div onClick={clearAll}>全部删除</div></Cell>
        </Cell.Group>
        {
            list && list.length > 0 ? list.map((item, index) => {
                return <Cell.Group key={index}>
                    <Cell onClick={() => {
                        searchClick(item)
                    }} title={item}> <Icon name="cross" onClick={(e) => { clearClick(index, e) }} />
                    </Cell>
                </Cell.Group>
            }) : ''
        }
    </div>)
}